package com.stedu.mall.goodsservice;

import com.stedu.mall.common.bean.Goods;
import com.stedu.mall.goodsservice.mapper.GoodsMapper;
import com.stedu.mall.goodsservice.mapper.GoodsPicMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.math.BigDecimal;

@SpringBootTest
public class mytest {
    @Autowired
    private GoodsMapper goodsMapper;
    @Autowired
    private GoodsPicMapper goodsPicMapper;
    @Test
    public void test1(){
        goodsPicMapper.selectByGoodsId(4)//少了个picList
                .stream()
                .forEach(System.out::println);
    }
    @Test
    public void test(){
        Goods condition = new Goods();
        condition.setName("华为");
        goodsMapper.selectByCondition(new Goods()).stream().forEach(System.out::println);
    }
    @Test
    public void test4(){
        Goods goods = new Goods(null , "华为P40", "华为P40", "华为P40", new BigDecimal(9999), new BigDecimal(8888), new BigDecimal(7777), "黑色", "8GB+128GB", 100, 1, 1, 1.0f, 1, null, null);
    }

    @Test
    public void test2(){
        goodsPicMapper.deleteByGoodsId(1000);
    }
    @Test
    public void test5(){
        System.out.println(goodsMapper.selectByCondition(new Goods()));
    }
}
